<?php
class Form_Login
    extends Zend_Form
{
    public function init()
    {
       # $this->addPrefixPath('GHub_Form_Decorator', 
       #                      'GHub/Form/Decorator',
       #                      'decorator');
  	$this->addElementPrefixPath('GHub_Form_Decorator', 
                             'GHub/Form/Decorator',
                             'decorator');
  	
    	$this->setAction('/index/login')
	 		 ->setMethod('post');

        $fname = new Zend_Form_Element_Text('fname');
        $fname->setLabel('First Name:')->setRequired(true);
        $fname->setAttrib('class', 'textbox');
        $fname->setAttrib('style', 'width: 250px');

        $lname = new Zend_Form_Element_Text('lname');
        $lname->setLabel('Last Name:')->setRequired(true);
        $lname->setAttrib('class', 'textbox');
        $lname->setAttrib('style', 'width: 250px');
       
        $submit = new Zend_Form_Element_Button('submit');
        $submit->setValue('Submit');
        $submit->setAttrib('class', 'form-button-grey');
        $submit->setAttrib('type', 'submit');
        
        $reject = new Zend_Form_Element_Button('reject');
        $reject->setValue('Reject');
        $reject->setAttrib('class', 'form-button-colour');
                
        $this->addElements(array($fname,$lname,$submit,$reject));
        
        $fname->setDecorators(array('ViewHelper',
        							'Label',
                    				array('FieldDescription', array('placement'=>'APPEND', 'text' => 'fsd sdf ss sdform-controls')),
                    				array(array('data' => 'HtmlTag'),  array('tag' =>'div', 'class'=> 'field')),
                    				array('FieldsetLegend', array('placement'=>'PREPEND', 'text' => 'Standard Fieldset')))
                    			   );
                    			   
        $lname->setDecorators(array('ViewHelper',
        							'Label',
        							array('FieldDescription',array('placement'=>'APPEND', 'text' => 'ffsff ntrols')),
                    				array(array('data' => 'HtmlTag'),  array('tag' =>'div', 'class'=> 'field')),
                    				array('FieldsetLegend', array('placement'=>'APPEND')))
                    			   );                   			   
                  			   
#FOR ONE BUTON:        
   #     $submit->setDecorators(array('ViewHelper',
   #    	 	array(array('data' => 'HtmlTag'),  array('tag' =>'div', 'class'=> 'form-controls'))
   #     ));
#FOR MORE BUTTONS 

        $submit->setDecorators(array('ViewHelper',
       	 	array('ButtonsWraper',array('placement'=>'PREPEND', 'cssclass' => 'form-controls'))
        ));
        
        $reject->setDecorators(array('ViewHelper',
       	 	array('ButtonsWraper',array('placement'=>'APPEND'))
        ));        			   
                    			   
        $this->setDecorators(array('FormElements',
        array('Form',array('class' =>'standard-form standard-form-small'))));
	return $this;
    }
}


